package com.k2data.k2app.domain.deviceRest;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.k2data.k2app.constant.Constant;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author lidong9144@163.com 17-3-20.
 */
@Data
@Table(name = "event")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Event implements Serializable {

    @Transient
    private static final long serialVersionUID = -819584920179009962L;

    @Id
    @GeneratedValue(generator = "JDBC")
    private Long id;
    private Long customerId;
    private Long deviceId;
    private String components;
    private String eventName;
    private String eventType;
    @JsonFormat(pattern = Constant.ISO_FORMAT)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime eventTime;
    @JsonFormat(pattern = Constant.ISO_FORMAT)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime startTime;
    @JsonFormat(pattern = Constant.ISO_FORMAT)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime endTime;
    private String owner;
    private String creator;
    private String eventDesc;
    private String eventDeal;
    private String eventResult;
    private String eventStatus;
    private String type;

    private String channelId;//通道id
    private String variableNameEn;//测点名称
    private String checkName;
    private String sensorName;
    private String sensorNameEn;
    private Long faultInfoValue;
    private List<REventPoint> eventPonts;

}
